﻿<div ng-controller="indexController" style="text-align:center ;float: left;" class="app-content-body app-body wrapper-md ng-scope contentElement">
    <!-- list -->
    <div class="menu-panel asideleft" style="text-align:center ;">
        <!--<menu>-->
        <!--<menu-item ishide="{{menu.ishide}}" key="{{menu.key}}" isclose="{{menu.isclose}}" active="{{menu.active}}" level="{{menu.level}}" linker="{{menu.linker}}" ng-click="click(this)" ng-repeat="menu in menus"></menu-item>-->
        <!--</menu>-->
        <ul class="top-ul">
            <li class="yue-li" ng-class="{'changed':change}" ng-click="changes=false;change=false;unOrder()">未预约<br><span style="">{{unLength}}</span></li>
            <li class="unyue-li" ng-class="{'changed':changes}" ng-click="change=true;changes=true;Order()">已预约<br><span style="">{{orLength}}</span></li>
        </ul>
        <div >
            <ul  class="list-ul yue-ul" ng-class="{'yued':lists.length<=7}">
                <li ng-class="{'checked':checkSure==$index }" ng-click="PatientList($index);PatientLists($event)" ng-repeat="m in lists"><span class="name" ng-class="{'gg':m.GenderCode==1,'mm':m.GenderCode==2}">{{m.PatName}}</span>
                    <span style="display: none">{{m.GenderCode }}</span>
                    <span class="age">{{m.Age}}岁</span><span class="come" ng-class="{'yuan':m.VisitType==2}"></span><span class="id">{{m.PatientId}}</span></li>
            </ul>
            <!--<ul class="list-ul unyue-ul" ng-class="{'yued':list.length<=7}" ng-if="changes">-->
            <!--<li ng-repeat="m in list"><span class="name" ng-class="{'gg':m.GenderCode=1}">{{m.PatName}}</span>-->
            <!--<span class="age">{{m.Age}}岁</span><span class="come" ng-class="{'yuan':m.VisitType=2}"></span><span class="id">{{m.PatientId}}</span></li>-->
            <!--</ul>-->
        </div>
        <ul class="right-ul"><li>Copyright&copy;2017</li><li>http://www.zhuojianchina.com</li><li>All rights Reserved</li><li>版权所有 杭州卓健信息科技有限公司</li></ul>

    </div>
    <div class="right" style="float: right;width: -webkit-calc(100% - 200px);padding-top: 5px;padding-left: 10px">
    <div class="col-sm-12 dataTables_wrapper form-ho rizontal dt-bootstrap wrapper_div">
        <!--<div class="col-sm-12 filter-block">-->
        <div>
            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-5 control-label">病人ID：</label>
                    <div class="col-sm-7">
                        <input class="sick-input form-control" type="text" ng-disabled="loseo" ng-model="searchdata.patientid" />
                    </div>
                </div>
            </div>
            <div class="col-sm-3 name-div">
                <div class="form-group">
                    <label class="col col-sm-5 control-label">姓名：</label>
                    <div class="col-sm-7">
                        <input type="text" placeholder="" id="searchName" class="form-control" ng-model="searchdata.PatName">
                    </div>
                </div>
            </div>
            <div class="col-sm-2 sex">
                <div class="form-group">
                    <label class="col col-sm-4 control-label">性别：</label>
                    <div class="col-sm-7">
                        <span class="man-span" ng-class="{'select':searchdata.GenderCode==1}" ng-click="searchdata.GenderCode=1"> <input type="radio" ng-model="searchdata.GenderCode"   name="sex"></span><span>男</span> <span class="w-span" ng-class="{'select':searchdata.GenderCode==2}" ng-click="searchdata.GenderCode=2"><input type="radio" ng-model="searchdata.GenderCode"    class="g" name="sex"></span><span>女</span>
                    </div>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="col-sm-5 control-label">出生日期：</label>
                    <div class="col-sm-7 date-birthday" ng-controller="DatepickerCtrl">
                        <div class="input-group birth-data">
                            <!--w-sm-->
                            <input type="text" class="form-control " datepicker-popup="{{format}}" ng-model="searchdata.DiagDatetime" is-open="opened" datepicker-options="dateOptions" ng-required="true" current-text="今天" clear-text="清除" close-text="关闭" ng-change="issueDateChange()" readonly />
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-default" ng-click="open($event);closeLR()"><i class="glyphicon glyphicon-calendar"></i></button>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-1" style="height:30px;">

            </div>
        </div>
        <div >
            <div class="col-sm-3" style="">
                <div class="form-group">
                    <label class="col-sm-5 control-label">申请单号：</label>
                    <div class="col-sm-7">
                        <input class="check-input form-control" ng-model="searchdata.ExamNo" ng-disabled="loset" type="text" placeholder="" id="searfchName">
                    </div>
                </div>
            </div>
            <div class="col-sm-3" style="">
                <div class="form-group">
                    <label class="col-sm-5 control-label">开单日期：</label>
                    <div class="col-sm-7 data-right" ng-controller="DatepickerCtrl">
                        <div class="input-group">
                            <!--w-sm-->
                            <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="searchdata.SympStartDatetime" is-open="opened" datepicker-options="dateOptions" ng-required="true" current-text="今天" clear-text="清除" close-text="关闭" ng-change="issueDateChange()" readonly />
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-default" ng-click="open($event);closeLB()"><i class="glyphicon glyphicon-calendar"></i></button>
                            </span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-sm-3" ng-controller="DatepickerCtrl" style="">
                <label class="col-sm-1 control-label" style="text-align:center !important">-</label>
                <div class="col-sm-7 input-group data-left">
                    <!--w-sm-->
                    <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="searchdata.SympEndDatetime" is-open="opened" datepicker-options="dateOptions" ng-required="true" current-text="今天" clear-text="清除" close-text="关闭" ng-change="issueDateChange()" readonly />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-default" ng-click="open($event);closeRB()"><i class="glyphicon glyphicon-calendar"></i></button>
                    </span>
                </div>
            </div>
            <div class="col-sm-1">

            </div>
            <div class="col-sm-1 pull-right search" ng-class="{'searchbtns':show}" style="">
                <a id="search" ng-click="search()" class="searchbtn ">
                </a>
            </div>
            <!--</div>-->
        </div>
    </div>
    <div id="divs" class="col-sm-12  form-ho" style="padding: 0">
        <div  class="col-sm-12 dan-div" style="height: 40px">
            <div class="xiangqing-div pull-left">申请单详情</div><ul class="pull-right middle-ul"><li ng-class="{'selected':ones}" name="1"  ng-click="all();ones=true;twos=false;threes=false" >全部</li><li ng-class="{'selected':twos}" ng-click="order();ones=false;twos=true;threes=false">已预约</li><li ng-class="{'selected':threes}" ng-click="unorder();ones=false;twos=false;threes=true">未预约</li></ul>
        </div>
        <div class="wrapper">
            <!--wrapper-md-->
            <div class="panel panel-default grid-panel">
                <div class="table-responsive">
                    <table id="table_dictsystem"
                           ui-table="dtOptions"
                           aa-data="dtData"
                           table-control="myTable"
                           ao-column-defs="columnDefs"
                           fn-row-callback="rowCallback"
                           class="table table-striped table-hovers m-b-none">
                        <thead>
                            <tr>
                                <th class="all" ng-click="checkall=0" ng-class="{'display':ones}">全选</th>
                                <th>序号</th>
                                <th>申请单号</th>
                                <th>检查类型</th>
                                <th>检查项目</th>
                                <th>预约时间</th>
                                <th>费别</th>
                                <th>申请医生</th>
                                <th>申请科室</th>
                                <th>申请日期</th>
                                <th>来源</th>
                                <th style="display: none">ExamItemCode</th>
                                <th style="display: none">项目</th>
                                <th style="display: none">部位</th>
                                <th style="display: none">PatientId</th>
                                <th style="display: none">Name</th>
                                <th style="display: none">VisitNo</th>
                                <th style="display: none">Gender</th>
                                <th style="display: none">ReservationId</th>
                                <th style="display: none">SerialNo</th>
                                <th style="display: none">DateOfBirth</th>
                                <th style="display: none">ReservationFlag</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="lunbo" style="width: 100%;clear: both;position: relative">
        <div class="rili" style="width: 100%">
            <div class="col-sm-11 col-md-11 col-lg-11" id="paginator-start-end"></div><div ng-class="{'selected':isGroup}" ng-click="choosed=0;showGroups()" class="fen  col-sm-1 col-md-1 col-lg-1" style=""></div>
        </div>
        <div class="fenzu-ul" ng-class="{'select':fenzu.length==1}" style="width: 100%">
            <!--<div ng-if="f==true" style="line-height: 133px;color: #2E96EF">点击上面日期获取可预约时间段</div>-->
            <div ng-if="status==1" style="line-height: 132px;color: #2E96EF"><span>请选中上面的申请单</span></div>
            <div ng-if="status==3" style="line-height: 132px;color: #2E96EF"><span>点击查询获取预约方案</span></div>
            <div ng-if="status==2" style="line-height: 132px;color: #2E96EF"><span>没有可预约的时间段</span></div>
            <div ng-if="status==5" style="line-height: 132px;color: #2E96EF"><span>已预约的项目可以取消预约</span></div>
            <div ng-if="status==6" style="line-height: 132px;color: #2E96EF"><span>选中项目中包含已预约项目，不能再预约</span></div>
            <div ng-if="status==4" style="height: 133px;color: #2E96EF" class="fangan-div">
                <ul style="list-style:none;height:133px; text-align:left" >
                    <span class="fangan-span" style="font-weight:bold; text-align:left;">预约信息：</span>
                    <li ng-repeat="calculateResult in calculateResults" style="line-height:20px;">
                        <label>申请单号：</label><span style="margin-right:20px">{{calculateResult.ExamNo}}</span><label>检查类型：</label><span style="margin-right:20px">{{calculateResult.ExamCategoryName}}</span><label>检查项目：</label><span style="margin-right:20px">{{calculateResult.ExamItemName}}</span><label>预约时段：</label><span>{{calculateResult.ReservationTime}}</span>
                    </li>
                </ul>
            </div>
            <button ng-if="status==0" ng-disabled="timeStage.SurplusCount==0" class="col-sm-{{colunmNum}} col-md-{{colunmNum}} col-lg-{{colunmNum}}" ng-class="{'selecte':selecte==$index}" ng-click="selected($index)" ng-repeat="timeStage in timeStages">
                <div ng-class="{'change':timeStage.OverCount!=timeStage.TotalCount}">
                    <span class="num-span">{{timeStage.OverCount==timeStage.TotalCount?"满":timeStage.SurplusCount}}</span>
                    <span class="z-span">
                    <span class="time-span">{{timeStage.TimeName}}</span><br>
                    <span class="all-span">总<strong class="b">{{timeStage.TotalCount}}</strong></span>
                    <span class="groupId-span" style="opacity: 0">{{timeStage.GroupId}}</span><br>
                    </span>
                </div>
            </button>
        </div>
        <div ng-if="isGroup==false" class="fenzu-ultwos" style="width: 100%;padding-left:0">未分组</div>
        <div ng-if="isGroup==true" class="fenzu-ultwo" style="width: 100%;padding-left:0">
            <li ng-repeat="fenzu in fenzus" style="float: left;display: inline-block;width: -webkit-calc(100%/{{fenzus.length}});width: calc(100%/{{fenzus.length}})" ng-class="{'selected':choosed==$index}" ng-click="choose($index)">分组{{fenzu}}</li>
        </div>
    </div>
    <div class="footer-div" style="clear: both">
        <span class="pull-left">你已选择</span>
        <span resizewidth class="footcontent" style="display:inline-block;text-align: left;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;">{{foomeassage}}{{fooTips}}&#x3000;</span><span class="foot-span-time" style="display: inline-block;width: 160px">{{tipTime}}&#x3000;{{tipHour}}</span>
        <button ng-click="submits()" ng-disabled="statuTime" ng-class="{'ButtonUse':!statuTime}" class="pull-right yuyue " >预约</button>
        <button ng-click="calculateResource()" ng-disabled="status!=3 && status!=4" ng-class="{'ButtonUse':status==3 || status==4}" class="pull-right calculate " >查询</button>
        <button ng-click="cancel()" ng-disabled="status!=5" ng-class="{'ButtonUse':status==5}" class="pull-right cancel col-sm-1" >取消预约</button>
    </div>
   </div>
</div>